package task15;

import java.util.Scanner;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/13 10:24
 * @description:测试类
 */
public class PrinterTest {

  public static void main(String[] args) {
    System.out.println("请输入：0表示使用HP，1表示Canon");
    Scanner scanner=new Scanner(System.in);
    int a=scanner.nextInt();
    PrinterFactory pf=new PrinterFactory();
    Printer printer=pf.getPrinter(a);
    printer.open();
    printer.print();
    printer.close();

    /*if (a == 0) {
      HPrinter hPrinter=new HPrinter();
      hPrinter.open();
      hPrinter.print();
      hPrinter.close();
    } else if(a==1){
      CPrinter cPrinter=new CPrinter();
      cPrinter.open();
      cPrinter.print();
      cPrinter.close();
    }else{
      System.out.println("输入有误");
    }*/
    }
  }
